#pragma once

/* 
@author: TriLVH
@description: interactive factory
*/

#include "AbstractEntity.h"

class InteractiveFactory {
public:
	// Interact action to check what type object object to do something
	static void interactAction(AbstractEntity* actorOne, AbstractEntity* actorTwo) {
		// Initialize type object 
		int typeOne = actorOne->getAbstractData()->getType();
		int typeTwo = actorTwo->getAbstractData()->getType();
		// check if actorOne is contra main player
		if (typeOne == _TYPE_CONTRA) {
			// if entityTwo is obstruction: land object
			if (typeTwo == _TYPE_OBS_GRASS_1) {
				_actionOfContraAndObsLand1(actorOne, actorTwo);
			}
		}
		// check if actorOne is runninng soilder
		//if (typeOne == _TYPE_
	}

private:
	// Interact contra player and other
	static void _actionOfContraAndObsLand1(AbstractEntity* actorOne, AbstractEntity* actorTwo) {
		// test scope
		Rect* rectOne = actorOne->getAbstractData()->getRect();
		Rect* rectTwo = actorTwo->getAbstractData()->getRect();
		// set rectOne up side of rectTwo

		rectOne->Y = rectTwo->Y - (rectOne->Height / 2 + rectTwo->Height / 2); 
	}
};